export default {
    data() {
        return {
            test11:"1"
        };
    },
    methods: {
        mySetInterval(cb, cancelCb) {
            let timer = null;
            let pre = new Date();
            let fn = function () {
                timer = requestAnimationFrame(() => {
                    let cur = new Date();
                    if (cur - pre >= 1000) {
                        cb();
                        pre = cur;
                    }
                    timer = requestAnimationFrame(fn);
                    if (cancelCb && cancelCb()) {
                        timer && cancelAnimationFrame(timer);
                    }
                });
            };
            fn();
        },

    
    },
}